package Dao.Impl;

import Dao.EmpDao;
import bean.Emp;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import util.DBUtils;

import java.sql.SQLException;
import java.util.List;

public class EmoDaoImpl implements EmpDao {
    /**
     * 员工数据库实现类
     * @return
     */
    @Override
    public List<Emp> getAllEmp() {
        QueryRunner queryRunner = new QueryRunner(DBUtils.getDataSource());
        try {
            List<Emp> query = queryRunner.query("select * from emp;", new BeanListHandler<Emp>(Emp.class));
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }

        return null;
    }
}
